﻿using System;

namespace BetterCS
{
  class Goto
  {
    public WaitDinosaur() : void {
      mutable value = 0;
      label: {
        for(mutable i = 0; i < 10; i++) 
        for(mutable j = 1; j <= i; j++) {
          when(value + j > 100) label();
          value += j;
        }
      };
      Console.WriteLine(value);
    }
    public WaitDeinonychus() : void {
      def sum = label: {
        mutable value = 0;
        for(mutable i = 0; i < 10; i++) 
        for(mutable j = 1; j <= i; j++) {
          when(value + j > 100) label(value);
          value += j;
        }
        value
      };
      Console.WriteLine(sum);
    }
  }
}
